const path = require("path")

const HTMLPlugin = require("html-webpack-plugin")
module.exports = {
    mode: "development", // 设置打包的模式，production表示生产模式  development 开发模式
    output: {
        clean: true // 自动清理打包目录
    }, 
    module: {
        rules: [
            {
                test: /\.m?js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                  loader: 'babel-loader',
                  options: {
                    presets: ['@babel/preset-env']
                  }
                }
              }
        ]
    },
  plugins: [new HTMLPlugin({
    title:"Hello Webpack"
  })],
  devtool: "inline-source-map"
}
